﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>本来生活网 礼品册</title>
    <link href="~/Content/GiftCard_files/css/Site.css" rel="stylesheet" type="text/css">
    <script src="~/Content/GiftCard_files/js/jquery-1.js" type="text/javascript"></script>
    <script src="~/Content/GiftCard_files/js/Basic.js" type="text/javascript"></script>
    <link href="~/Content/GiftCard_files/css/gift_002.css" rel="stylesheet" type="text/css">
    <link href="~/Content/GiftCard_files/css/giftcard.css" rel="stylesheet" type="text/css">
    <link href="~/Content/GiftCard_files/css/gift.css" rel="stylesheet" type="text/css">
    <link href="~/Content/GiftCard_files/css/common.css" rel="stylesheet" type="text/css">
    <link href="~/Content/GiftCard_files/css/top_footer.css" rel="stylesheet" type="text/css">


    <link href="~/Content/GiftCard_files/css/uesrs.css" rel="stylesheet" type="text/css">


    <link href="~/Content/GiftCard_files/css/newgiftcard.css" rel="stylesheet" type="text/css">

</head>

<body>

    <div class="top" style="width:100%;">

        <div class="top" style="width:100%;">
            <div class="topt">
                <div class="box990">
                    <div class="topt_l"></div>
                    <div class="topt_r"></div>
                    <div class="clear"></div>
                </div>
            </div>
            <div class="box990">
                <div class="topnew gift_top">
                    <div class="logonew fl"><a href="http://www.benlai.com/"><img src="~/Content/GiftCard_files/image/logo_new.gif"></a></div>
                    <div class="fl ml10 logo_banner channel" style="width:140px">【礼品频道】</div>
                    <div class="cartft mt">
                        <div class="cartftt">
                            <h2>销售/客服&nbsp;4008-000-917</h2>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="gift_menu">
                        <ul>

                            <li><a href="http://gift.benlai.com/" class="on">首 页</a></li>
                            <li><a href="http://www.benlai.com/giftcard/lipince">时尚礼品册</a></li>
                            <li><a href="http://www.benlai.com/giftcard">礼金卡</a></li>
                            <li><a href="http://www.benlai.com/giftcard/grouppurchasing">单品集采</a></li>
                            <li><a href="http://www.benlai.com/giftcard/service">服 务</a></li>
                            <li><a href="http://www.benlai.com/giftcard/contact">联系我们</a></li>
                        </ul>
                    </div>
                </div>
            </div>

        </div>




        <script src="~/Content/GiftCard_files/image/login.js" type="text/javascript"></script>
        <script type="text/javascript">

    //全局变量
    var subType = "duihuan";
    var submit_lock = "0";
    var i = 0;

    $(function () {
        //按下Enter提交礼品卡号和密码
        document.onkeydown = function (e) {
            var ev = document.all ? window.event : e;
            if (ev.keyCode == 13) {
                if (subType == "chaxun") {
                    doCardCheck();
                } else if (subType == "duihuan") {
                    doCardLogin();
                }
            }
        }

        //验证码输入框鼠标移出检测
        $("#vry_duihuan").focus(function () {
            if ($(this).val() == "输入验证码") {
                $(this).val("");
            }
        }).blur(function () {
            if ($(this).val() == "") {
                $(this).val("输入验证码");
            }
        });
        //礼品卡号输入框鼠标移出检测
        $("#ipt_card_duihuan").focus(function () {
            if ($(this).val() == "请输入礼品册编号") {
                var pwd = $("#ipt_card_duihuan");
                $(this).css('color', 'black');
                $("#ipt_card_duihuan").val("");
            }
        }).blur(function () {
            if ($(this).val().indexOf(" ") != -1 && $(this).val() != "") {
                //$(this).css('color', '#BEBEBE');
                showMsg('对不起，礼品册号为纯数字');
            }
            else if (isNaN($(this).val()) && $(this).val() != "")
            {
                showMsg('对不起，礼品册号为纯数字');
            }else {
                $("#allMsg").html("&nbsp;");
                $("#ipt_card_duihuan").css("box-shadow", "0px 0px 0px #ff0000");
                $("#ipt_card_duihuan").css("border", "0px solid #ff0000");
            }
        });
        //密码输入框鼠标移出检测
        //$("#ipt_pwd_duihuan").focus(function () {
        //    if ($(this).val() == "请输入密码") {
        //        var pwd = $("#ipt_pwd_duihuan");
        //        $("#ipt_pwd_duihuan").val("");
        //        $(this).css('color', 'black');
        //        pwd.attr("type", "password");
        //        $("#ipt_pwd_duihuan").attr('type', 'password')
        //    }
        //}).blur(function () {
        //    if ($(this).val() == "") {
        //        var pwd = $("#ipt_pwd_duihuan");
        //        pwd.attr("type", "text");
        //        $("#ipt_pwd_duihuan").attr("type", "text")
        //    }
        //});


        //刷新验证码
        ReplaceVryImg1();

        //图片轮播
        setInterval(changeImage, "5000");
        //鼠标点击切换图片
        $(".gift_home_banner").find("a").click(function () {
            $(this).attr("class","on");
            $(this).siblings().attr("class", "");
            var id = $(this).attr("id");
            var index = id.substring(id.length - 1, id.length);
            var imgUrl = "//image.benlailife.com/images/oldbanner/subject/20121126gift/gift_banner0" + index + ".jpg"
            $(".gift_home_banner").find("img").first().attr("src", imgUrl);
        });
    });

    function changeImage() {
        var index = (i % 3 + 1);
        var currentLink = $("#changeImage" + index);
        var imgUrl = "//image.benlailife.com/images/oldbanner/subject/20121126gift/gift_banner0" + index + ".jpg"
        currentLink.attr("class", "on");
        currentLink.siblings().attr("class", "");
        $(".gift_home_banner").find("img").first().attr("src", imgUrl);
        i++;
    }

    function changeForm(str_type) {
        if (str_type == "chaxun") {
            showMsg();
            ReplaceVryImg2();
            $("#div_chaxun").show();
            $("#div_duihuan").hide();
            $('#a_duihuan').removeClass();
            $('#a_chaxun').addClass('on');
            subType = "chaxun";
        } else {
            showMsg();
            ReplaceVryImg1();
            $("#div_chaxun").hide();
            $("#div_duihuan").show();
            $('#a_chaxun').removeClass();
            $('#a_duihuan').addClass('on');
            subType = "duihuan";
        }

    }

    //礼品卡兑换
    function doCardLogin() {
        showMsg();
        var num = 0;
        var giftCardNo = $("#ipt_card_duihuan").val().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        var pwd = $("#ipt_pwd_duihuan").val().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        var vryCode = $("#vry_duihuan").val().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        if ($.trim(giftCardNo) == "" || giftCardNo == null || giftCardNo == '请输入礼品册编号') {
            showMsg('请输入礼品册编号');
            $("#ipt_card_duihuan").css("box-shadow", "0px 0px 3px #ff0000");
            $("#ipt_card_duihuan").css("border", "1px solid #ff0000");
            num = 1;
        }
        if (pwd == "" || pwd == null) {
            showMsg('请输入密码');
            $("#ipt_pwd_duihuan").css("box-shadow", "0px 0px 3px #ff0000");
            $("#ipt_pwd_duihuan").css("border", "1px solid #ff0000");
            num = 1;
        }
        if (vryCode == "" || vryCode == null || vryCode == "输入验证码") {
            showMsg('输入验证码');
            $("#vry_duihuan").css("box-shadow", "0px 0px 3px #ff0000");
            $("#vry_duihuan").css("border", "1px solid #ff0000");
            num = 1;
        }
        if ($("#ipt_card_duihuan").val().indexOf(" ") != -1 && $("#ipt_card_duihuan").val() != "") {
            //$(this).css('color', '#BEBEBE');
            showMsg('对不起，礼品册号为纯数字');
            $("#ipt_card_duihuan").css("box-shadow", "0px 0px 3px #ff0000");
            $("#ipt_card_duihuan").css("border", "1px solid #ff0000");
            num = 1;
        }
        if (isNaN($("#ipt_card_duihuan").val()) && $.trim(giftCardNo)!= "")
        {
            showMsg('对不起，礼品册号为纯数字');
            $("#ipt_card_duihuan").css("box-shadow", "0px 0px 3px #ff0000");
            $("#ipt_card_duihuan").css("border", "1px solid #ff0000");
             num = 1;
        }
        if (num==1) {
            return;
        }

        if (submit_lock == "0") {
            submit_lock = "1";
            $.ajax({
                type: 'POST',
                url: '/GiftCard/CardLogin?giftCardNo=' + giftCardNo + '&pwd=' + pwd + '&vryCode=' + vryCode + "&checkType=1",
                cache: false,
                success: function (data) {
                    if (data == "True") {
                        $("#vry_duihuan").val("输入验证码");
                        //跳转到商品列表页面
                        submit_lock = "0";
                        window.location.href = "/GiftExchange";
                    } else {
                        submit_lock = "0";
                        showMsg(data);
                        ReplaceVryImg1();
                        $("#vry_duihuan").val("输入验证码");
                    }

                }, error: function (ex) {
                    confirm(ex);
                }
            })
        }

    }

    //礼品卡查询
    function doCardCheck() {
        showMsg();
        var giftCardNo = $("#ipt_card_chaxun").val().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        var pwd = $("#ipt_pwd_chaxun").val().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        var vryCode = $("#vry_chaxun").val().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        if (giftCardNo == "" || giftCardNo == null) {
            showMsg('请输入礼品卡卡号！');
            return;
        }
        if (pwd == "" || pwd == null) {
            showMsg('请输入礼品卡密码！');
            return;
        }
        if (vryCode == "" || vryCode == null || vryCode == "输入验证码") {
            showMsg('请输入验证码！');
            return;
        }

        if (submit_lock == "0") {
            submit_lock = "1";
            $.ajax({
                type: 'POST',
                url: '/GiftCard/CardLogin?giftCardNo=' + giftCardNo + '&pwd=' + pwd + '&vryCode=' + vryCode + "&checkType=2",
                cache: false,
                success: function (date) {
                    if (AjaxValidate(date)) {
                        if (date == "True") {
                            $("#vry_duihuan").val("输入验证码");
                            //跳转到商品列表页面
                            submit_lock = "0";
                            window.location.href = "/CheckOrderStatus";
                        } else {
                            submit_lock = "0";
                            showMsg(date);
                            ReplaceVryImg2();
                            $("#vry_duihuan").val("输入验证码");
                        }
                    }
                }
            })
        }
    }

    function showMsg(showStr) {
        if (showStr != null) {
            if (showStr == "请输入礼品册编号") {
                $("#ipt_card_duihuan").css('border', 'red');
                $("#giftcardNOMsg").html("<font style='color:red;'>" + showStr + "</font>");
            } else if (showStr == "请输入密码") {
                $("#pwdMsg").html("<font style='color:red;'>" + showStr + "</font>");
            } else if (showStr == "输入验证码") {
                $("#errorMsg").html("<font style='color:red;'>" + showStr + "</font>");
            } else if (showStr == "验证码输入错误！") {
                $("#errorMsg").html("<font style='color:red;'>" + showStr + "</font>");
                $("#vry_duihuan").css("box-shadow", "0px 0px 3px #ff0000");
                $("#vry_duihuan").css("border", "1px solid #ff0000");
            }
            else {
                $("#allMsg").html("<font style='color:red;'>" + showStr + "</font>");
            }


        } else {
            $("#giftcardNOMsg").html("&nbsp;");
            $("#pwdMsg").html("&nbsp;");
            $("#errorMsg").html("&nbsp;");
            $("#allMsg").html("&nbsp;");
            $("#ipt_card_duihuan").css("box-shadow", "0px 0px 0px #ff0000");
            $("#ipt_card_duihuan").css("border", "0px solid #ff0000");
            $("#ipt_pwd_duihuan").css("box-shadow", "0px 0px 0px #ff0000");
            $("#ipt_pwd_duihuan").css("border", "0px solid #ff0000");
            $("#vry_duihuan").css("box-shadow", "0px 0px 0px #ff0000");
            $("#vry_duihuan").css("border", "0px solid #ff0000");

        }
    }

        </script>
        <div class="box990">
            <!--首页 开始-->
            <div class="gift_home_tit">礼品册兑换</div>
            <div class="gift_home_banner">
                <dl>
                    <dt>
                        <a id="changeImage1" href="javascript:;" class="on"></a>
                        <a id="changeImage2" href="javascript:;" class=""></a>
                        <a id="changeImage3" href="javascript:;" class=""></a>
                    </dt>
                    <dd><img src="~/Content/GiftCard_files/image/gift_banner01.jpg"></dd>
                    <dd><img src="~/Content/GiftCard_files/image/gift_banner02.jpg"></dd>
                    <dd><img src="~/Content/GiftCard_files/image/gift_banner03.jpg"></dd>
                </dl>
            </div>
            <div class="gift_home_login">
                <dl>

                    <dd id="allMsg"></dd>
                    <dd><div class="tit">编  号</div><input value="请输入礼品册编号" maxlength="20" class="gift_long on" id="ipt_card_duihuan" style="color:#BEBEBE;" type="text"></dd>

                    <dd id="giftcardNOMsg" style="line-height:18px;">&nbsp;</dd>
                    <dd><div class="tit">密  码</div><input class="gift_long" id="ipt_pwd_duihuan" type="password"></dd>
                    <dd id="pwdMsg" style="line-height:18px;">&nbsp;</dd>
                    <dd>
                        <input value="输入验证码" class="gift_short" id="vry_duihuan" name="txtoldcode1" type="text">
                        <img id="imgCode1" alt="" src="~/Content/GiftCard_files/image/GetVryImgGen.jpg">
                        <a href="javascript:;" onclick="ReplaceVryImg1()">换一张</a>
                    </dd>
                    <dd id="errorMsg" style="line-height:18px;">&nbsp;</dd>
                    <dd class="gift_home_btn">
                        <a href="javascript:void(0);" onclick="doCardLogin()">
                            <img src="~/Content/GiftCard_files/image/gift_home_btn04.gif">
                        </a>
                        <span class="texttsh_lo cleb6100" id="CodeErrors1" style="color: Red"></span>
                    </dd>

                </dl>
            </div>
            <div class="gift_home_bg01"><a href="http://www.benlai.com/giftcard/lipince"><img src="~/Content/GiftCard_files/image/gift_home_btn01.png"></a></div>
            <div><img src="~/Content/GiftCard_files/image/gift_home02.jpg"><img src="~/Content/GiftCard_files/image/gift_home03.jpg"></div>
            <div class="gift_home_bg02"><a href="http://www.benlai.com/giftcard"><img src="~/Content/GiftCard_files/image/gift_home_btn02.png"></a></div>
            <div><img src="~/Content/GiftCard_files/image/gift_home05.jpg"><img src="~/Content/GiftCard_files/image/gift_home06.jpg"></div>
            <div class="gift_home_bg03"><a href="http://www.benlai.com/giftcard/grouppurchasing"><img src="~/Content/GiftCard_files/image/gift_home_btn03.png"></a></div>
            <!--首页 结束-->
        </div>

        <div class="footer">
            <div class="footer">
                <div class="footert">
                    <dl>
                        <dt class="xs">新手指南</dt>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/1">用户须知</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/2">购物流程</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/3">会员政策</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/7">联系客服</a></dd>
                    </dl>
                    <dl>
                        <dt class="ps">配送方式</dt>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/9">全程冷链</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/10">配送时间</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/11">配送范围</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/12">配送收费标准</a></dd>
                    </dl>
                    <dl>
                        <dt class="zf">支付方式</dt>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/13">货到付款</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/14">在线支付</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/15">其他支付方式</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/21">优惠券使用</a></dd>
                    </dl>
                    <dl>
                        <dt class="sh">售后服务</dt>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/17">验货与拒收政策</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/18">退换货政策</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/19">退换货流程</a></dd>
                        <dd><a target="_blank" href="http://www.benlai.com/Help/Index/25">退款流程</a></dd>
                    </dl>
                </div>
                <div style="text-align:center"><img src="~/Content/GiftCard_files/image/bottom6.gif" height="69" width="796"></div>
                <div class="footerb">
                    <div style="text-align:center; line-height:26px; padding-top:5px;">
                        <div style="padding-bottom:2px;"><img src="~/Content/GiftCard_files/image/tel.gif" style="margin-right:4px; margin-bottom:4px;vertical-align:middle;" height="13" width="17"><span style="font-weight:bold; font-size:14px;font-family:Microsoft YaHei;">客服热线：4008-000-917（周一至周日 8:00-20:00）</span></div>
                        <a href="http://www.benlai.com/Help/Index/22" target="_blank">关于我们</a> | <a href="http://www.benlai.com/Help/Index/23" target="_blank">食品流通许可证</a> | <a href="http://www.miitbeian.gov.cn/" target="_blank">京ICP证120338号</a> | <a href="http://www.benlai.com/Help/Index/24" target="_blank">营业执照</a><br>CopyRight：www.benlai.com  2012，All Rights Reserved　北京本来工坊科技有限公司
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>

    </div>
</body>
</html>
